<?php
/**
 * Created by PhpStorm.
 * User: User
 * Date: 2017/10/16
 * Time: 18:40
 */
class DB
{
    private  static $obj=null;
    private function  __construct()
    {

    }
   public static  function getObj()
    {
        if(is_null(self::$obj)){
            self::$obj=new DB();
        }
        return self::$obj;
    }
    public  function  select()
    {
        echo "select data...";
    }
}
var_dump(DB::getObj());
var_dump(DB::getObj());
var_dump(DB::getObj()==DB::getObj());